package org.wotou.authority.service.wtuser;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.wotou.authority.dao.wtuser.WtuserDAO;
import org.wotou.authority.domain.wtuser.wtuserDO;

import javax.transaction.Transactional;
import java.util.List;

/**
 * 用户操作
 *
 * @author zhangQ
 * @date 2017/12/19
 */
@Service
public class WtuserService {

    @Autowired
    private WtuserDAO wtuserDAO;

    /**
     * 按条件查询用户
     *
     * @param wtuser
     * @return
     */
    public List<wtuserDO> queryByCondition(wtuserDO wtuser) {
        List<wtuserDO> wtuserList = wtuserDAO.findByUserName(wtuser.getUserName());
        return wtuserList;
    }

    @Transactional
    public void add(wtuserDO wtuser) {
        wtuserDAO.save(wtuser);
    }
}
